﻿@using Covenant.Models.Covenant
@using Microsoft.AspNetCore.Identity
@inject UserManager<CovenantUser> UserManager
@model CovenantUserRegister

<link rel="stylesheet" href="~/css/signin.css" />

<div class="covenant-logo">
    <img class="mb-5" src="~/images/covenant-white.png" height="175" width="602">
    @if (!UserManager.Users.Any())
    {
        <form asp-controller="CovenantUser" asp-action="Create" class="form-signin">
            <div asp-validation-summary="All" class="text-danger"></div>
            <h1 class="h5 text-white">Register Initial User</h1>
            <input asp-for="UserName" class="form-control mb-3" placeholder="Username" required autofocus>
            <input asp-for="Password" class="form-control" placeholder="Password" type="password" required>
            <input asp-for="ConfirmPassword" class="form-control mb-3" placeholder="Confirm Password" type="password" required>
            <button type="submit" class="btn btn-lg btn-outline-primary btn-block">Register</button>
        </form>
    }
    else
    {
        <form asp-controller="CovenantUser" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]" class="form-signin">
            <div asp-validation-summary="All" class="text-danger"></div>
            <input asp-for="UserName" class="form-control" placeholder="Username" required autofocus>
            <input asp-for="Password" class="form-control mb-3" placeholder="Password" type="password" required>
            <button type="submit" class="btn btn-lg btn-outline-primary btn-block">Login</button>
        </form>
    }
</div>